#ifndef HTTPUPLOAD_H
#define HTTPUPLOAD_H

#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkReply>

QT_BEGIN_NAMESPACE
namespace Ui { class HttpUpload; }
QT_END_NAMESPACE

class HttpUpload : public QWidget
{
    Q_OBJECT

public:
    HttpUpload(QWidget *parent = nullptr);
    ~HttpUpload();

private slots:
    void on_pushButton_selectUploadFile_clicked();
    void on_pushButton_startUpload_clicked();

    //自定义槽信号
    void onUpLoadFinished();
    void onUpLoadError(QNetworkReply::NetworkError errorCode);
    void OnUploadProgress( qint64 bytesSent, qint64 bytesTotal );
private:
    Ui::HttpUpload *ui;

    QNetworkAccessManager * _pUploadManager = nullptr;
    QNetworkReply * _pReply = nullptr;
};
#endif // HTTPUPLOAD_H
